package com.lnlyj.media;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * wanglei 2020-04-18
 */
public class Config implements Parcelable {

    // 最大选择的图片数量
    private int selectCount = 9;
    // 预览显示几列
    private int spanCount = 4;
    // 媒体类型图片/视频, 暂无实现
    private int mediaType = 1;

    public Config() {
    }

    public Config(int selectCount, int spanCount, int mediaType) {
        this.selectCount = selectCount;
        this.spanCount = spanCount;
        this.mediaType = mediaType;
    }

    protected Config(Parcel in) {
        selectCount = in.readInt();
        spanCount = in.readInt();
        mediaType = in.readInt();
    }

    public static final Creator<Config> CREATOR = new Creator<Config>() {
        @Override
        public Config createFromParcel(Parcel in) {
            return new Config(in);
        }

        @Override
        public Config[] newArray(int size) {
            return new Config[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(selectCount);
        parcel.writeInt(spanCount);
        parcel.writeInt(mediaType);
    }

    public int getSelectCount() {
        return selectCount;
    }

    public void setSelectCount(int selectCount) {
        this.selectCount = selectCount;
    }

    public int getSpanCount() {
        return spanCount;
    }

    public void setSpanCount(int spanCount) {
        this.spanCount = spanCount;
    }

    public int getMediaType() {
        return mediaType;
    }

    public void setMediaType(int mediaType) {
        this.mediaType = mediaType;
    }
}
